<?php

declare (strict_types=1);
namespace App\Model;

/**
 * @property int $id 
 * @property int $user_id 操作用户ID
 * @property string $action 操作类型
 * @property string $description 操作描述
 * @property string $ip_address ip地址
 * @property string $user_agent 用户代理
 * @property string $request_data 请求数据
 * @property string $response_data 响应数据
 * @property \Carbon\Carbon $created_at
 *
 * @property-read User $user
 */
class SystemLog extends Model
{
    const UPDATED_AT = null;
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'system_logs';
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = ['id', 'user_id', 'action', 'description', 'ip_address', 'user_agent', 'request_data', 'response_data', 'created_at'];
    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = ['id' => 'integer', 'user_id' => 'integer', 'created_at' => 'datetime'];

    public function user()
    {
        return $this->belongsTo(User::class);
    }
}